class Skill:
    def __init__(self, no, name, cd, atk, mp):
        self.no = no
        self.name = name
        self.cd = cd
        self.atk = atk
        self.mp = mp

    def __str__(self):
        return '%s,%s,%s,%s,%s' % (self.no, self.name, self.cd, self.atk, self.mp)


def get_no(list_target, no):
    for skill in list_target:
        if no == skill.no:
            yield skill


def get_cd(list_target, cd):
    for skill in list_target:
        if skill.cd == cd:
            yield skill


def get_atk(list_target, atk):
    for skill in list_target:
        if int(skill.atk) > int(atk):
            yield skill


def get_atk_without_mp(list_target, atk):
    for skill in list_target:
        if int(skill.atk) > int(atk) and int(skill.mp) == 0:
            yield skill


def find_all(target, func):
    for item in target:
        if func(item):
            yield item


def find_demo02(item):
    if int(item.cd) == 0:
        return True


def find_demo3(item):
    if int(item.atk) > 5:
        return True


def find_demo4(skill):
    if int(skill.atk) > 10 and int(skill.mp) == 0:
        return True


list_skill = [Skill('101', '誓约之盾', '3', '5', '0'),
              Skill('102', '回旋打击', '3', '7', '0'),
              Skill('103', '圣剑裁决', '10', '15', '0'),
              Skill('104', '凋零冰晶', '3', '6', '1'),
              Skill('105', '禁锢寒霜', '5', '8', '2'),
              Skill('106', '凛冬已至', '10', '20', '6'),
              Skill('-1', '普通攻击', '0', '2', '0')
              ]
for skill in get_no(list_skill, '101'):
    print(skill)

result01 = [item for item in list_skill if item.no == '101']
print(result01)
generator = (item for item in list_skill if item.no == '101')
for item in generator:
    print(item)

print("-------------")
for skill in get_cd(list_skill, '0'):
    print(skill)

result01 = [item for item in list_skill if item.cd == '0']
print(result01)
for item in (item for item in list_skill if item.cd == '0'):
    print(item)
for item in find_all(list_skill, find_demo02):
    print(item)
print("-------------")
for skill in get_atk(list_skill, '5'):
    print(skill)

result01 = [item for item in list_skill if int(item.atk) > 5]
print(result01)
for item in (item for item in list_skill if int(item.atk) > 5):
    print(item)
print("-------------")
for skill in get_atk_without_mp(list_skill, '10'):
    print(skill)

result01 = [item for item in list_skill if int(item.atk) > 10 and item.mp == '0']
print(result01)
for item in (item for item in list_skill if int(item.atk) > 10 and item.mp == '0'):
    print(item)
